﻿(function() {
  var buildPath = "../../build/";
  requirejs.config({
    baseUrl: "app",
    paths: {
      text: buildPath + "require/text",
      durandal: buildPath + "durandal/js",
      plugins: buildPath + "durandal/js/plugins",
      transitions: buildPath + "durandal/js/transitions",
      knockout: buildPath + "knockout/knockout-3.5.0.debug",
      bootstrap: buildPath + "bootstrap/js/bootstrap",
      jquery: buildPath + "jquery/jquery-3.4.1",
      components: "components"
    },
    shim: {
      bootstrap: {
        deps: ["jquery"], //依赖jquery
        exports: "jQuery" //bootstrap是扩展了jQuery的方法，仍然用的全局变量是Window.jQuery
      }
    }
  });
})();

define(["durandal/system", "durandal/app", "durandal/viewLocator"], function(
  system,
  app,
  viewLocator
) {
  //>>excludeStart("build", true);
  system.debug(true);
  //>>excludeEnd("build");

  app.title = "Durandal Starter Kit";

  app.configurePlugins({
    router: true,
    dialog: true
  });

  app.start().then(function() {
    //Replace 'viewmodels' in the moduleId with 'views' to locate the view.
    //Look for partial views in a 'views' folder in the root.
    viewLocator.useConvention();

    //Show the app by setting the root view model for our application with a transition.
    //定义入口，页面切换特效
    app.setRoot("shell/index", "entrance");
  });
});
